package com.yuanlrc.hotel.news.domain;

import java.util.Date;

import com.yuanlrc.common.annotation.Excel;
import com.yuanlrc.common.core.domain.BaseEntity;
import com.yuanlrc.system.domain.SysUser;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;
import org.hibernate.validator.constraints.Length;
import org.springframework.validation.annotation.Validated;

/**
 * 新闻管理对象 ylrc_news
 * 
 * @author yuanlrc
 * @date 2020-11-19
 */
public class News extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** null */
    private Long id;

    /** 标题 */
    @Excel(name = "标题")
    private String total;

    /** 新闻图片 */
    @Excel(name = "新闻图片")
    private String newsPic;

    /** 发布人id */
    @Excel(name = "发布人id")
    private Long author;

    /** 内容 */
    @Excel(name = "内容")
    private String content;

    /** 点击量 */
    @Excel(name = "点击量")
    private Long hits;

    /** 创建时间 */
    @Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date ctime;

    /** 用户对象 */
    @Excel(name = "登录后台的用户",targetAttr = "loginName",type = Excel.Type.EXPORT)
    private SysUser user;

    public SysUser getUser() {
        return user;
    }

    public void setUser(SysUser user) {
        this.user = user;
    }

    public void setId(Long id)
    {
        this.id = id;
    }

    public Long getId() 
    {
        return id;
    }
    public void setTotal(String total) 
    {
        this.total = total;
    }

    public String getTotal() 
    {
        return total;
    }
    public void setNewsPic(String newsPic) 
    {
        this.newsPic = newsPic;
    }

    public String getNewsPic() 
    {
        return newsPic;
    }
    public void setAuthor(Long author) 
    {
        this.author = author;
    }

    public Long getAuthor() 
    {
        return author;
    }
    public void setContent(String content) 
    {
        this.content = content;
    }

    public String getContent() 
    {
        return content;
    }
    public void setHits(Long hits) 
    {
        this.hits = hits;
    }

    public Long getHits() 
    {
        return hits;
    }
    public void setCtime(Date ctime) 
    {
        this.ctime = ctime;
    }

    public Date getCtime() 
    {
        return ctime;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("total", getTotal())
            .append("newsPic", getNewsPic())
            .append("author", getAuthor())
            .append("content", getContent())
            .append("hits", getHits())
            .append("ctime", getCtime())
            .toString();
    }
}
